public class NarcissisticNumber {
    public static void main(String[] args) {

        int n = 1000;
        int i = 0;
        int j = 0;
        int paragon = 0;
        int sum = 0;
        int part = 1;

        for (i = 100; i < n; i++) {
            paragon = i;

            while (paragon != 0) {
                for (j = 3; j > 0; j--) {
                    part *= paragon % 10;
                }

                sum += part;
                part = 1;
                paragon /= 10;
            }

            if (sum == i) {
                System.out.println(sum);
            }

            sum = 0;
        }
    }
}
